package cn.xopencode.recordservice.provider.sf6machine;

import cn.xopencode.common.framework.vo.CommonResult;
import cn.xopencode.common.framework.vo.PageResult;
import cn.xopencode.recordservice.manager.sf6machine.Sf6MachineRecordManager;
import cn.xopencode.recordservice.rpc.robotroom.dto.AdminRecordPageDTO;
import cn.xopencode.recordservice.rpc.sf6machine.Sf6MachineRecordRpc;
import cn.xopencode.recordservice.rpc.sf6machine.dto.*;
import cn.xopencode.recordservice.rpc.sf6machine.vo.*;
import org.apache.dubbo.config.annotation.DubboService;
import org.springframework.beans.factory.annotation.Autowired;

/**
 * SF6气体密度继电器巡检记录 Rpc 实现类
 */
@DubboService(version = "${dubbo.provider.Sf6MachineRecordRpc.version}")
public class Sf6MachineRecordRpcImpl implements Sf6MachineRecordRpc {

    @Autowired
    private Sf6MachineRecordManager sf6MachineRecordManager;

    @Override
    public CommonResult<Sf6MachineRecordCreateVO> createSf6MachineRecord(Sf6MachineRecordCreateDTO createDTO) {
        return CommonResult.success(sf6MachineRecordManager.createSf6MachineRecord(createDTO));
    }

    @Override
    public CommonResult<Integer> createSf6MachineRecordNextLine(Sf6MachineRecordNextCreateDTO nextCreateDTO) {
        return CommonResult.success(sf6MachineRecordManager.createSf6MachineRecordNextLine(nextCreateDTO));
    }

    @Override
    public CommonResult<PageResult<Sf6MachineRecordPageVO>> pageSf6MachineRecord(Sf6MachineRecordDTO pageDTO) {
        return CommonResult.success(sf6MachineRecordManager.pageSf6MachineRecord(pageDTO));
    }

    @Override
    public CommonResult<Sf6MachineRecordVO> getSf6MachineRecordById(String id) {
        return CommonResult.success(sf6MachineRecordManager.getSf6MachineRecordById(id));
}

    @Override
    public CommonResult<Sf6MachineRecordNextVO> getSf6MachineRecordNextById(String recordCode, Integer recordSeq) {
        return CommonResult.success(sf6MachineRecordManager.getSf6MachineRecordNextById(recordCode, recordSeq));
    }

    @Override
    public CommonResult<Integer> updateSf6MachineRecord(Sf6MachineRecordUpdateDTO updateDTO) {
        return CommonResult.success(sf6MachineRecordManager.updateSf6MachineRecord(updateDTO));
    }

    @Override
    public CommonResult<Integer> updateSf6MachineRecordNextLine(Sf6MachineRecordNextUpdateDTO nextUpdateDTO) {
        return CommonResult.success(sf6MachineRecordManager.updateSf6MachineRecordNextLine(nextUpdateDTO));
    }

    @Override
    public CommonResult<Integer> dealSf6MachineRecordLineException(String recordDetailId) {
        return CommonResult.success(sf6MachineRecordManager.dealSf6MachineRecordLineException(recordDetailId));
    }

    @Override
    public CommonResult<PageResult<Sf6MachineRecordAdminPageVO>> getAdminPageSf6MachineRecordLine(AdminRecordPageDTO pageDTO) {
        return CommonResult.success(sf6MachineRecordManager.getAdminPageSf6MachineRecordLine(pageDTO));
    }
}
